<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    1.
    /*
    function getMax(){
        let max=arguments[0];
        for(let i=0;i<arguments.length;i++){
            if(arguments[i]!='number'){
                return NaN;
            }
            if(arguments[i]>max){
                max=arguments[1];
            }
        }   return max;
    }
console.log(getMax(23,124,-8764));
   */
/*	console.log('1--------')	
	function getmax(a,b,c){	
	    let max=a;	
	    if(typeof (a=='number' )){	
	        if(a>b){	
	            max=a;	
	        }else{	
	            max=b;	
            }    
		if(max>c){
        	return max;	
	        }else{	
	        return c;	
            }
	        } else{	
	        console.log('NAN');	
	        }	
        }
	console.log(getmax(23,124,-8764));	
    console.log('2-----------');		
    let s=[15,68,69,72, 83];	
	function getarrmax(m){	
	    let max=s[0];	
	    for(let i=1;i<m.length;i++){	
	        if(m[i]>max){
                max=m[i];
            }
        }
        return max;
    }
        */
    2.
   /* function getarrmax(arr){
       let max=arr[0];
       for (let i=1;i<=arr.length;i++){
            if(arr[i]>max){
                max=arr[i];
            }
        }
        return max;
    }
    let s=getarrmax([13,68,79,92,83]);
    console.log(s);*/
3.
function reverse(){
    let arr=[1,2,3,4,7];
    let c=[];
    for(let i=arr.length-1;i>= 0;i--){
        c[c.length]= arr[i];
    }
        console.log(c);
        return c;
    }
        reverse();
        
      /*  console.log(getarrmax(shuzi));
        function reverse(){
            let sz=['1','2','3','4','5'];
            let dz=[];
            for(let i=sz.length-1;i>=0;i--){
                dz[dz.length]=sz[i];
            }
            return dz;
        }
        console.log(reverse());
    4.
   /* function isLeapYear(year) {
    if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
        return true;
    } else {
        return false;
    }
}
console.log(isLeapYear(2024));
console.log(isLeapYear(2021));
    */
   3.
  /*function reverse(arr) {
  var newArr = [];
  for (var i = arr.length - 1; i >= 0; i--) {
    newArr[newArr.length] = arr[i];
  }
  return newArr;
}
var arr1 = reverse([1, 2, 3, 4, 5]);
console.log(arr1);	
*/
5.
  /*function fn() {
  var year = prompt('请输入年份：');
  if (isLeapYear(year)) {  alert('当前年份是闰年,2月份有29天'); }
  else {  alert('当前年份是平,2月份有28天'); }
}
function isLeapYear(year) {
	var flag = false;
	if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
	flag = true;
	}
	return flag;

}
    */
/*6.
function get(){
    let max=arguments[0];
    for(let i =1;i< arguments.length;i++){
        if(arguments[i]>max){
            max=arguments[i];
        }
    }
    console.log(max);
    console.log(arguments.length);
}
get(1,4,55,78,-45,90);
*/

</script>
</html>